﻿SELECT * FROM t_weburl_top AS twt
WHERE twt.ShowToAll = 1 OR twt.Id IN (SELECT twtp.Id FROM t_weburl_top_permission AS twtp WHERE twtp.RoleOrLevelId = 0 AND twtp.AccountType = 0)